You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TMtxExpression Class > TMtxExpression Methods > DefineFunction Method > TMtxExpression.DefineFunction Method ([In] string, TExprFunc, int, int, [In] string)
Dew Math for .NET
ContentsIndexHome
Example

Add factorial function to the function list.

using Dew.Math; using Dew.Math.Units; namespace Dew.Examples() { void Example() { void _Factorial_D (TExprRec Param) { Param.Res.DefineDouble; Param.Res.DoubleValue = Fact(System.Math.Round(Param.Args[0].DoubleValue)); } void Example(TMtxExpression MyParser); { myParser.DefineFunction("fact_double", _Factorial_D, 1, "fact_double(x): factorial function"); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.